% ECGPLOT       Plotting static ECG
% data: data points recorded in the file (.bin)
% 
% See also: xlim, ylim
% Copyright: Group 8
% Modified at 20th Oct 2010
%-------------------------------------------------------------------------
function Data_staticplot = ecgplot(v,x_lowlim,x_uplim,y_lowlim,y_uplim)
%% time reconstruction and graph plotting
t = (0:length(v)-1)/553.6;
% Setting zero-centre line at 0 and plotting the graph
c = zeros(length(v),1);

plot(t,v,'r',t,c,'k');
%% Setting axes
% Auto for y-axis
% Fixed X-axis value
if nargin == 1
    xlim('auto');
    ylim([-5,6]);
elseif nargin == 3
    xlim([x_lowlim,x_uplim]);
    ylim([-5,6]);
else
    xlim([x_lowlim,x_uplim]);
    ylim([y_lowlim,y_uplim]);
end
grid on;
%% Labeling axes 
ylabel('Magnitude')
xlabel('time / s')
%% Setting artistic properties
set(findobj('Type','line'),'linewidth',2);
 